package com.inventive.jmscache.server;

import javax.transaction.xa.XAResource;
import java.util.List;

/**
 * @author Grant Little grant.little@inventivesoftware.com.au
 */
public interface BackendCache {
    void start();
    void stop();
    BackendQueue getQueue(String name);
    BackendTopic getTopic(String name);

    void startTransaction();
    void commitTransaction();
    void rollbackTransaction();

    List<JmsCacheMessage> getMessages(String queueName, String messageSelector);

    List<String> getSubscriptionsForTopic(String name);
    void addMessageIdToSubscription(String subscriptionId, String messageId);

    XAResource getXAResource();

}
